package cn.dakaqi.dao.user;

import cn.dakaqi.entities.user.VolunteerMoney;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;

/**
 * Created by chunyang on 2016/5/4.
 */
public interface VolunteerMoneyDao extends PagingAndSortingRepository<VolunteerMoney, Long>, JpaSpecificationExecutor<VolunteerMoney>
{
    @Query(nativeQuery = true,value = "select sum(MONEY) FROM U_VOLUNTEER_MONEY WHERE VOLUNTEER_ID =:VOLUNTEER_ID")
    Long findByMemberCode(@Param("VOLUNTEER_ID") Long VOLUNTEER_ID);

}
